package com.venusj.springcloud.alibaba.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created By Administrator
 * User: VenusZ
 * Date: on 2020/3/26 23:10
 * Desc:  需要手动发送 curl -X POST "http://localhosty:3355/actuator/refresh" 请求  来刷新 3355端口
 * 告诉3355 自动取获取更新新的配置信息 config.info
  */
@RestController
@RefreshScope  // 实现配置动态刷新
public class ConfigClientController {


    @Value("${config.info}")
    private String configInfo;

    @GetMapping("/configInfo")
    public String getConfigInfo() {
        return configInfo;
    }
}
